/**
 * Created by LC on 2019/11/19
 */
package com.hw.paltfrom.controller.mainscreen;

import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.mainscreen.RankListService;
import com.hw.paltfrom.utils.ResponeResultUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("rank")
public class RankListController {

    @Autowired
    RankListService rankListService;

    /**
     *
     * @param dataType 需要的数据类型 "检测车辆" "超限车辆" "源头企业"
     * @return 不传:参数错误,没数据:未查到数据
     */
    @RequestMapping("list")
    public Map<String,Object> queryRankList(String dataType){
        if (StringUtils.isBlank(dataType)){
            return ResponeResultUtil.fail(HWSystemCode.PARAMS_ERROR);
        }
        return rankListService.queryRankList(dataType);
    }
}
